package thread.wang_bao_ling.c30;

public class TestThreadLocal {
    private static ThreadLocal<Integer> integerThreadLocal = new ThreadLocal<>();
    private static ThreadLocal<String> stringThreadLocal = new ThreadLocal<>();

    public static void main(String[] args) {
        new Thread(()->setThreadLocal(1,"str1"),"t1").start();
        new Thread(()->setThreadLocal(2,"str2"),"t1").start();
    }

    public static void setThreadLocal(Integer i,String s) {
        integerThreadLocal.set(i);
        stringThreadLocal.set(s);
    }

}
